package archive;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/*
 * Sql facilitator
 * by Martin Robinson
 * */

public interface Sql {
	/**
	 * execute query
	 * @param sql as String the sql query
	 * @return true
	 * @throws SQLException
	 */
	boolean exec(final String sql) throws SQLException;
	/**
	 * return string from table
	 * @param table as String table name
	 * @return String of table dumping
	 * @throws SQLException
	 */
	String view(final String table) throws SQLException;
	/**
	 * build list of map from table
	 * @param qu as String query
	 * @return list of map
	 * @throws SQLException
	 */
	List<Map> query(final String qu) throws SQLException;
	
	/**
	 * build map from first row of the request
	 * @param qu as String query
	 * @return map
	 * @throws SQLException
	 */
	Map queryMap(final String qu)throws SQLException;
	
	
	/**
	 * test if query return something
	 * @param req as string sql query
	 * @return boolean
	 * @throws SQLException
	 */
	public boolean exist(final String req) throws SQLException;

}
